<template>
  <aside class="menu" style="">
    <ul style="margin:0;padding-top:10px">
      <li style="margin:20px" v-if="security.authen">
        <a href="http://localhost/item/itemList.html"  target="view_window" style="height: 24px;line-height: 24px;font-size: 18px;">店铺后台 </a>
      </li>
      <hr>
      <li class="person">
        <a href="javascript:;;">用户管理</a>
        <ul>
          <li> <router-link :to="{name:'user'}" v-bind:style="{color:checked('user')}">个人信息</router-link></li>
          <li> <router-link :to="{name:'address'}" v-bind:style="{color:checked('address')}">收货地址</router-link></li>
          <li> <router-link :to="{name:'securityli'}" v-bind:style="{color:checked('securityli')}">安全中心</router-link></li>
        </ul>
      </li>
      <li class="person">
        <a href="javascript:;;">我的资产</a>
        <ul>
          <li> <router-link :to="{name:'account'}" v-bind:style="{color:checked('account')}">账户信息 </router-link></li>
          <li> <router-link :to="{name:'integral'}" v-bind:style="{color:checked('integral')}">积分明细 </router-link></li>
          <li> <router-link :to="{name:'bill'}" v-bind:style="{color:checked('bill')}">账单管理</router-link></li>
        </ul>
      </li>
      <li class="person">
        <a href="javascript:;;">交易管理</a>
        <ul>
          <li> <router-link :to="{name:'order'}" v-bind:style="{color:checked('order')}">订单管理</router-link></li>
          <!-- <li> <a href="/admin/trade/change.html">退款售后</a></li> -->
          <li> <router-link :to="{name:'comments'}" v-bind:style="{color:checked('comments')}">订单评价</router-link></li>
        </ul>
      </li>
      <li class="person">
        <ul>
          <li> <router-link :to="{name:'foot'}" v-bind:style="{color:checked('foot')}">我的足迹</router-link></li>
          <!-- <li> <a href="/admin/trade/change.html">退款售后</a></li> -->
          <li> <router-link :to="{name:'collect'}" v-bind:style="{color:checked('collect')}">我的收藏</router-link></li>
          <li> <router-link :to="{name:'messages'}" v-bind:style="{color:checked('messages')}">消息管理</router-link></li>
        </ul>
      </li>
    </ul>
  </aside>
</template>
<<script>
export default {
    name: 'leftmenu',
    data(){
      return{
        route:"",
         security:{}
      }
    },
    mounted () {
      this.route=this.$route.name;
          this.qrySecurity();
      console.log(this.$route.name)
    },
    methods: {
      checked(name){
        var routename=this.route;
        if (routename=="bills") {
          routename="bill";
        }
        if (name==routename) {
          return "#409EFF"
        }else{
          return ""
        }
      },
       qrySecurity(){
      this.axios.get("/user/security").then((res)=>{
        let result = res.data;
        if(result.code==200){
          this.security = result.data;
        }
      })
    }
    }
}
</script>
<style scoped>
@import "/src/AmazeUI-2.4.2/assets/css/admin.css";
@import "/src/AmazeUI-2.4.2/assets/css/amazeui.css";
@import "/src/assets/css/personal.css";
@import "/src/assets/css/footstyle.css";
</style>